comboPtns is package{
  
  comp has type ((%t) <= %t, (%t) <= %t) => ((%t) <= %t);
  comp(P1, P2) is (pattern (X) from P1(P2(X)));
   
  gt5(X) from X where X > 5;
  lt10(X) from X where X < 10;
   
  smPrimes is relation{2; 3; 5; 7; 11};

  medPrimes() is all X where (gt5(X) matching lt10(X)) in smPrimes;
   
  medPrimes2() is all X where comp(gt5, lt10)(X) in smPrimes;
   
  med is comp(gt5, lt10);
  medPrimes3() is all X where med(X) in smPrimes;
   
  main() do {
    assert medPrimes() = array of {7};
     
    assert medPrimes2() = array of {7};
     
    assert medPrimes3() = array of{7};
  }
}

